#! /bin/bash
sleep 5
# export ROS_HOSTNAME=192.168.233.44
# export ROS_MASTER_URI=http://192.168.233.22:11311
# export ROS_IP=192.168.233.44

source /home/firefly/Projects/ws_livox/devel/setup.bash
gnome-terminal -- bash -c "roslaunch fast_lio mapping_mid360.launch"
sleep 4
gnome-terminal -- bash -c "roslaunch livox_ros_driver2 msg_MID360.launch"
sleep 2
gnome-terminal -- bash -c "python3 fuck_t265.py" 
sleep 2
source /home/firefly/ws_pixhawk/devel/setup.bash
gnome-terminal -- bash -c "rosrun state_machine if_lida_ok"
sleep 2
# source /home/firefly/ws_vision/devel/setup.bash
# gnome-terminal -- bash -c "rosrun flypcl detect_stick"

# python /home/firefly/fuck_t265.py &
# disown


# sleep 30
sleep 5
source /opt/ros/noetic/setup.bash 
gnome-terminal -- bash -c "roslaunch mavros px4.launch"
sleep 2
source /home/firefly/ws_pixhawk/devel/setup.bash
chmod 777 /dev/ttyUSB0
chmod 777 /dev/ttyUSB1
sleep 2
gnome-terminal -- bash -c "rosrun mcu_correspond mcu_serial_correspond"
sleep 2
# 启动 flyeye ROS 节点
# source /home/firefly/ws_vision/devel/setup.bash
# chmod 777 /dev/video0
gnome-terminal -- bash -c "roslaunch flyeye uu.launch"
sleep 2
gnome-terminal -- bash -c "rosrun flyeye pr3basic"
sleep 2 

source /home/firefly/ws_pixhawk/devel/setup.bash
gnome-terminal -- bash -c "rosrun base_control base_fly"
sleep 1
# gnome-terminal -- bash -c "rosrun state_machine image_send"
# sleep 1
# gnome-terminal -- bash -c "rosrun state_machine add_point"
# sleep 1
# gnome-terminal -- bash -c "rosrun state_machine decision"
gnome-terminal -- bash -c "roslaunch state_machine state_machine.launch"
sleep 1

gnome-terminal -- bash -c "python3 /home/firefly/ws_pixhawk/src/state_machine/scripts/p2023.py"

gnome-terminal -- bash -c "python3 /home/firefly/ws_pixhawk/src/state_machine/scripts/pose_forword.py"
# source /home/firefly/ws_vision/devel/setup.bash

# gnome-terminal -- bash -c "rosrun state_machine testt"
# gnome-terminal -- bash -c "rosrun three training_2024" 
# sleep 2
# gnome-terminal -- bash -c "rosrun trx2024 fake_sender" 

# sleep 2
# gnome-terminal -- bash -c "rosrun flyeye vision2uart"

# gnome-terminal -- bash -c "rosbag record /usb_cam/image_raw -O /home/firefly/temp/img_raw.bag "

